home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-04-14 | 3.9 KB | 105 lines | [TEXT/MPS ] |
- *
- * Apple Macintosh Developer Technical Support
- *
- * DriverGlue
- *
- * DriverGlue.inc1.a - Assembler Source
- *
- * Copyright © 1989 Apple Computer, Inc.
- * All rights reserved.
- *
- * Versions:
- * 1.00 08/88
- * 1.01 11/88
- * 1.02 04/89 MPW 3.1
- *
- * Components:
- * DriverGlue.a April 1, 1989
- * DriverGlue.inc1.a April 1, 1989
-
- * ----------- DEBUGGING INFORMATION -------------
- * This is used as a global switch to turn off the generation of debugging information.
- * The MACRO "DbgInfo" will generate this debugging information if set to 1.
-
- DebuggerInfo EQU 1
-
- * ------------- GENERATE DEBUGGER SYMBOL INFORMATION -------------
- * This Macro will generate information for the debugger to read and display
- * as its module name. This aids in debugging Asm code while looking at it
- * in the debugger. This macro can only work if called at the end of stack
- * frame. The appearance of the Macro statement in the source code must occur
- * immediately after the final "JMP (A0)" or "RTS" instruction following the UNLINK.
- * Spaces may be included in the name, but no quotes are allowed.
-
- * {Form #1} DbgInfo ModName
- * {Form #2} DbgInfo.New Really Long Module Name For MacsBug 6.0
-
- * There are now two naming conventions used in MacsBug, Form #1 is the older MacsBug,
- * or TMON, and Form #2 is the newer MacsBug 6.0. The older method would only
- * allow for a fixed length of eight characters. If a shorter name is passed to
- * this Macro, it will extend the length to 8 chars with trailing spaces.
- * MacsBug 6.0 will now allow for a variable length C type string. This Macro will
- * create the proper DC statements and takes into account word alignment issues.
-
-
- MACRO
- DbgInfo.&Opt &ModName# ; the name to be used in the Debugger
- PRINT Push,NoMDir ; Only list generated code
- LCLC &DbgName# ; name to generate for MacsBug
- LCLC &DbgTemp ; temporary name variable
- LCLC &New ; variable used to test old vs. new
- LCLC &S ; variable used to save PRINT state
-
- IF DebuggerInfo THEN ; do we want debugging info?
- IF &ModName# ≠ '' THEN ; did we get a module name?
- &New: SETC &UpCase(&Opt) ; make option all upper case
- IF (&New = 'NEW') THEN ; do we want new style?
-
- .* Create the new MacsBug naming convention
- * -----------------------------------------------
- &DbgTemp: SETC &ModName# ; generate new type symbols
- IF &Len(&ModName#) < 32 THEN ; if module name < 32 chars
- IF &Len(&ModName#) // 2 = 0 THEN ; add space if even so that...
- &DbgTemp: SETC &Concat(&ModName#,' ') ; string length plus length byte...
- ENDIF ; will align to word boundary
- &DbgName#: SETC &Concat(&Chr($80 + &Len(&ModName#)), &DbgTemp)
- ELSE ; Length > 32 characters
- IF &Len(&ModName#) // 2 = 1 THEN ; add space if length is odd
- &DbgTemp: SETC &Concat(&ModName#,' ')
- ENDIF
- &DbgName#: SETC &Concat(&Chr($80), &Chr(&Len(&ModName#)), &DbgTemp)
- ENDIF
- ELSE ; make it the older style
-
- .* Create the older MacsBug naming convention
- * -----------------------------------------------
- IF &Len(&ModName#) < 8 THEN ; if module name < 8 chars
- &DbgName#: SETC &Concat(&ModName#,' ') ; add at least 7 spaces
- &DbgName#: SETC &Concat(&Chr($80 + &ORD(&SubStr(&DbgName#,1,1))), &SubStr(&DbgName#,2,7))
- ELSE ; there are at least 8 chars
- &DbgName#: SETC &Concat(&Chr($80 + &ORD(&SubStr(&ModName#,1,1))), &SubStr(&ModName#,2,7))
- ENDIF
- ENDIF
-
- .* Create the DC.B with the debugger name, and include the NULs if new MacsBug option
- * -----------------------------------------------
- &S: SETC &Setting('STRING') ; preserve STRING status
- IF &S ≠ 'ASIS' THEN ; only change it if not already ASIS
- STRING ASIS
- DC.B '&DbgName#'
- IF (&New = 'NEW') THEN
- DC.W 0 ; fake literal size for new MacsBug
- ENDIF
- STRING &S
- ELSE
- DC.B '&DbgName#'
- IF (&New = 'NEW') THEN
- DC.W 0 ; fake literal size for new MacsBug
- ENDIF
- ENDIF
- ENDIF
- ENDIF
-
- PRINT Pop ; restore original print status
- ENDM
-